<%--
  Created by IntelliJ IDEA.
  User: 王坤华
  Date: 2021/11/29
  Time: 10:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/fileupload.js"></script>
    <link rel="stylesheet" href="bootstrap-4.6.0-dist/css/bootstrap.css">
    <link rel="stylesheet" href="css/img.css">
    <%--    <link rel="stylesheet" href="css.css">--%>
</head>
<body>
<form>
    cengji:<input type="text" name="cengji"><br>
    wuliaobianhao:<input type="text" name="wuliaobianhao"><br>
    wuliaomingcheng:<input type="text" name="wuliaomingcheng"><br>
    xinghaoguige:<input type="text" name="xinghaoguige"><br>
    danwei:<input type="text" name="danwei"><br>
    yongliang:<input type="text" name="yongliang"><br>
    weizhi:<input type="text" name="weizhi"><br>
    beizhu:<input type="text" name="beizhu"><br>
    <input type="button" value="添加明细" onclick="addd()">
</form>
</body>
<script>
    function addd(){
        let formData = new FormData($("form")[0]);
        $.ajax({
            url:"addd.do",
            data:formData,
            type:"post",
            dataType:"json",
            processData:false,
            contentType:false,
            success:function (obj) {
                if (obj>0){
                    alert("添加明细成功")
                    location="toadd.do"
                }
            }
        })
    }
</script>
</html>
